


/**
 * 
 * @author Simon Auner 2011-11-28
 * @param {Object} cfg The config object
 * @param {String} cfg.label Button label
 * @param {Function} cfg.callback The function callback when button is pressed
 * @param {Number} cfg.width The width of button in pixels
*/
function Button(cfg) {
    
    var me = this;
    me.button = document.createElement("button");
    var button = me.button;
    
    button.innerText = cfg.label;
    button.className = "clean-gray";
    
    button.style.width = cfg.width + "px";
    
    button.addEventListener("mousedown", function() {
        
    }, false);
    
    button.addEventListener("mouseup", function() {
        cfg.callback();
    }, false);
    
    return button;
    
}